<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>Document</title>
</head>

<body>

    <div id="app">
        <div :style="{fontSize:fontSize +'px'}">{{msg}}</div>
        <mesn-button @enlarge-text="handle($event)"></mesn-button>
    </div>

    <script src="../vue.js"></script>
    <script>
        Vue.component("mesn-button", {
            props: ['font'],
            data() {
                return {

                }
            },
            template: `<div>
                         <button @click="$emit('enlarge-text',5)">点击增加父组件字体大小</button>
                         <button @click="$emit('enlarge-text',10)">点击增加父组件字体大小</button>
                       </div`,
        })
        const vm = new Vue({
            el: "#app",
            data: {
                msg: '父组件的字体大小',
                fontSize: 10
            },
            methods: {
                handle(val) {
                    this.fontSize += val
                }
            }
        })
    </script>
</body>

</html>